<!DOCTYPE html>
<html lang="zh-CN" xmlns:th="http://www.thymeleaf.org">
<head>
<th:block data-th-replace="/adminlte/base::base-head"></th:block>
<link rel="stylesheet"
	href="/plugins/datatables-bs4/css/dataTables.bootstrap4.css">
</head>
<body class="hold-transition sidebar-mini layout-fixed">
	<div class="wrapper">
		<th:block data-th-replace="/adminlte/base::base-navbar"></th:block>
		<th:block data-th-replace="/adminlte/base::base-main-sidebar"></th:block>
		<div class="content-wrapper">
			<th:block data-th-replace="/adminlte/base::base-content-header"></th:block>
			<section class="content">
				<div class="container-fluid">
					<div class="card">
						<div class="card-body">
							<div class="table-responsive">
								<table id="data-table"
									class="table table-bordered table-hover table-striped">
									<colgroup>
										<col width="300" />
										<col />
										<col width="200" />
										<col width="120" />
										<col width="120" />
										<col width="100" />
									</colgroup>
									<thead>
										<tr>
											<th>名字</th>
											<th>链接路径</th>
											<th>链接描述</th>
											<th>路径参数</th>
											<th>请求参数</th>
											<th>验证</th>
										</tr>
									</thead>
									<tbody>
										<tr data-th-each="link: ${linkList}" th:with="class=${link.validated?'text-success':''}">
											<td data-th-utext="${link.name}">权限名称</td>
											<td data-th-utext="${link.patternList}" data-th-class="${class}">权限名称</td>
											<td data-th-utext="${link.responseDesc.remark}" data-th-class="${class}">权限别名</td>
											<td>
                                                <button th:unless="${link.pathValues.isEmpty()}"
                                                    data-dialog="url"
                                                    th:data-url="${'/admin/json?param='+ApiLinkUtils.getPathValueString(link)}"
                                                    class="btn btn-info w-100">路径参数
                                                </button>
                                            </td>
                                            <td>
                                                <button th:unless="${link.paramValues.isEmpty()}"
                                                    data-dialog="url"
                                                    th:data-url="${'/admin/json?param='+ApiLinkUtils.getParamValueString(link)}"
                                                    class="btn btn-info w-100">请求参数
                                                </button>
                                            </td>
											<td data-th-utext="${link.validated?'需要权限':'无需权限'}" data-th-class="${class}"></td>
										</tr>
									</tbody>
								</table>
							</div>
						</div>
					</div>
				</div>
			</section>
		</div>
		<th:block data-th-replace="/adminlte/base::base-footer"></th:block>
		<th:block data-th-replace="/adminlte/base::base-control-sidebar"></th:block>
	</div>
	<script src="/plugins/datatables/jquery.dataTables.js"></script>
	<script src="/plugins/datatables-bs4/js/dataTables.bootstrap4.js"></script>
	<script type="text/javascript" src="/kaibes/js/table-data.js"></script>
	<script type="text/javascript">
		$(function(){
			dataTable(0, [2, 3, 4]);
			$("[type='search']").width("400");
		});
	</script>
</body>
</html>